package com.hsc.yalebao.newui;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.hsc.yalebao.base.BaseActivity;
import com.hsc.yalebao.base.CustomApplication;
import java.io.File;

public class UpNewHtmlActivity extends BaseActivity
  implements View.OnClickListener
{
  private WebView mCotentWebView;
  private ProgressBar mPb;
  private int mType = -1;
  private String mUrl = "";
  View.OnClickListener onClickListener = new View.OnClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      switch (paramAnonymousView.getId())
      {
      default:
        return;
      case 2131099699:
      }
      CustomApplication.app.finishActivity(UpNewHtmlActivity.this);
    }
  };
  private TextView tv_title;

  private void initData()
  {
    this.mCotentWebView.setWebViewClient(new WebViewClient()
    {
      public void onPageFinished(WebView paramAnonymousWebView, String paramAnonymousString)
      {
        super.onPageFinished(paramAnonymousWebView, paramAnonymousString);
      }

      public boolean shouldOverrideUrlLoading(WebView paramAnonymousWebView, String paramAnonymousString)
      {
        if ((paramAnonymousString != null) && ("tel".equals(paramAnonymousString.substring(0, 3))))
        {
          localIntent = new Intent("android.intent.action.DIAL", Uri.parse(paramAnonymousString));
          localIntent.setFlags(268435456);
          UpNewHtmlActivity.this.startActivity(localIntent);
        }
        while ((paramAnonymousString == null) || (!paramAnonymousString.startsWith("http")))
        {
          Intent localIntent;
          return true;
        }
        paramAnonymousWebView.loadUrl(paramAnonymousString);
        return true;
      }
    });
    this.mCotentWebView.loadUrl(this.mUrl);
  }

  public void init()
  {
    Bundle localBundle = getIntent().getExtras();
    if (localBundle != null)
    {
      this.mUrl = localBundle.getString("url");
      this.mType = localBundle.getInt("type", -1);
    }
    setTitle(8, 0, 2130837809, "", 8, 8, 0);
    this.mPb = ((ProgressBar)findViewById(2131099858));
    this.mCotentWebView = ((WebView)findViewById(2131099859));
    this.mPb.setMax(100);
    this.mCotentWebView.setScrollBarStyle(33554432);
    this.mCotentWebView.getSettings().setJavaScriptEnabled(true);
    this.mCotentWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    this.mCotentWebView.getSettings().setSupportMultipleWindows(true);
    this.mCotentWebView.getSettings().setCacheMode(2);
    this.mCotentWebView.getSettings().setDomStorageEnabled(true);
    this.mCotentWebView.getSettings().setAppCacheMaxSize(8388608L);
    String str = getApplicationContext().getCacheDir().getAbsolutePath();
    this.mCotentWebView.getSettings().setAppCachePath(str);
    this.mCotentWebView.getSettings().setAllowFileAccess(true);
    this.mCotentWebView.getSettings().setAppCacheEnabled(true);
    this.mCotentWebView.setWebChromeClient(new WebChromeClient()
    {
      public void onProgressChanged(WebView paramAnonymousWebView, int paramAnonymousInt)
      {
        UpNewHtmlActivity.this.mPb.setVisibility(0);
        UpNewHtmlActivity.this.mPb.setProgress(paramAnonymousInt);
        if (paramAnonymousInt == 100)
          UpNewHtmlActivity.this.mPb.setVisibility(8);
        super.onProgressChanged(paramAnonymousWebView, paramAnonymousInt);
      }

      public void onReceivedTitle(WebView paramAnonymousWebView, String paramAnonymousString)
      {
        super.onReceivedTitle(paramAnonymousWebView, paramAnonymousString);
        Log.e("ANDROID_LAB", "TITLE=" + paramAnonymousString);
        if (UpNewHtmlActivity.this.mType == 0)
        {
          UpNewHtmlActivity.this.tv_title.setText("官方查询");
          return;
        }
        UpNewHtmlActivity.this.tv_title.setText(paramAnonymousString);
      }
    });
    this.mCotentWebView.setWebViewClient(new WebViewClient()
    {
      public void onPageFinished(WebView paramAnonymousWebView, String paramAnonymousString)
      {
        super.onPageFinished(paramAnonymousWebView, paramAnonymousString);
      }

      public boolean shouldOverrideUrlLoading(WebView paramAnonymousWebView, String paramAnonymousString)
      {
        if (paramAnonymousString != null)
          paramAnonymousWebView.loadUrl(paramAnonymousString);
        return true;
      }
    });
    initData();
  }

  public void onClick(View paramView)
  {
    paramView.getId();
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903059);
    init();
  }

  public void onDestroy()
  {
    super.onDestroy();
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if ((paramInt == 4) && (this.mCotentWebView.canGoBack()))
    {
      this.mCotentWebView.goBack();
      return true;
    }
    return super.onKeyDown(paramInt, paramKeyEvent);
  }

  public void setTitle(int paramInt1, int paramInt2, int paramInt3, String paramString, int paramInt4, int paramInt5, int paramInt6)
  {
    View localView = findViewById(2131099716);
    this.tv_title = ((TextView)localView.findViewById(2131099701));
    this.tv_title.setText(paramString);
    if (this.mType == 0)
      this.tv_title.setText("官方查询");
    while (true)
    {
      ((TextView)localView.findViewById(2131099700)).setVisibility(paramInt1);
      ImageView localImageView1 = (ImageView)localView.findViewById(2131099699);
      localImageView1.setVisibility(paramInt2);
      localImageView1.setOnClickListener(this.onClickListener);
      localImageView1.setImageResource(paramInt3);
      TextView localTextView = (TextView)localView.findViewById(2131099702);
      localTextView.setVisibility(paramInt4);
      localTextView.setOnClickListener(this.onClickListener);
      ImageView localImageView2 = (ImageView)localView.findViewById(2131099704);
      localImageView2.setVisibility(paramInt5);
      localImageView2.setImageResource(paramInt6);
      return;
      this.tv_title.setText("");
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.newui.UpNewHtmlActivity
 * JD-Core Version:    0.6.2
 */